package com.sc.byahi.user.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.SpanElement;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import com.sc.byahi.user.client.components.HistoryTokens;

public class Stage extends Composite {

	private static StageUiBinder uiBinder = GWT.create(StageUiBinder.class);

	interface StageUiBinder extends UiBinder<Widget, Stage> {
	}

	@UiField
	SpanElement heading;
	@UiField
	SpanElement description;

	public Stage() {
		initWidget(uiBinder.createAndBindUi(this));
		
	}
	
	public void setText(){
		String token = History.getToken();
		if(token != null){
			if (HistoryTokens.DASHBOARD.equals(token)) {
				this.heading.setInnerText("Dashboard");
				this.description.setInnerText("View all the details about your profile, who is interested in you, and in whose profile you have shown interest.");
			}
			if (HistoryTokens.SEARCH.equals(token)) {
				this.heading.setInnerText("Search Profiles");
				this.description.setInnerText("Search profiles on Byahi. You can save searches for future use.");
			}
			if (HistoryTokens.EDIT_PROFILE.equals(token) || token.startsWith(HistoryTokens.EDIT_PROFILE)) {
				this.heading.setInnerText("Change Profile");
				this.description.setInnerText("Here you can change your profile. It will take some time to verify your profile after edit. During that time it won't be visible for other users.");
			}
			if (HistoryTokens.PROFILE.equals(token)) {
				this.heading.setInnerText("View Profile");
				this.description.setInnerText("View your profiles. Chanage or upload pictures by clicking provided buttons.");
			}
			if (HistoryTokens.SEARCH_ID.equals(token)) {
				this.heading.setInnerText("Search Profile by Profile ID");
				this.description.setInnerText("Search a profile if someone has sent you a profile ID.");
			}
			if (HistoryTokens.SEARCH_UNAPPROVED.equals(token)) {
				this.heading.setInnerText("Search Unapproved Profiles");
				this.description.setInnerText("Search all unapproved profiles.");
			}
			if (HistoryTokens.ADD_PROFILE.equals(token)) {
				this.heading.setInnerText("Create Your Profile");
				this.description.setInnerText("Create your profile. Make sure you fill all the boxes with red outline.");
			}
			if (HistoryTokens.MY_PROFILES.equals(token)) {
				this.heading.setInnerText("Your Profiles");
				this.description.setInnerText("All your profiles.");
			}
			if (HistoryTokens.SUCCESS.equals(token)) {
				this.heading.setInnerText("Submit Your Success Story");
				this.description.setInnerText("Express your gratitude by submitting a few words about how Byahi helped you.");
			}
			if (HistoryTokens.CONTACT.equals(token)) {
				this.heading.setInnerText("Contact Us");
				this.description.setInnerText("Some information about how to contact us.");
			}
			if (HistoryTokens.HELP.equals(token)) {
				this.heading.setInnerText("Help");
				this.description.setInnerText("Here is some help on how to use this site. We are trying to create detailed help, meanwhile if there is something that is not clear, feel free to contact us.");
			}
			if (token.startsWith(HistoryTokens.SEARCH_RESULT)) {
				this.heading.setInnerText("Results");
				this.description.setInnerText("Results for your search.");
			}
			if (token.startsWith(HistoryTokens.MY_PROFILE_ID)) {
				this.heading.setInnerText("Results");
				this.description.setInnerText("Results for your search.");
			}
			if (token.startsWith(HistoryTokens.ID_SEARCH_RESULT)) {
				this.heading.setInnerText("Results");
				this.description.setInnerText("Results for your search.");
			}
		}else{
			this.heading.setInnerText("Byahi");
			this.description.setInnerText("A website to search your life partner.");
			
		}
		
	}
}
